/* GSBusOrderResolveReceiveSaveAction.java
 *
 * Project/Product: JZCG-SHBUS
 *
 * Modify Information:
 * =============================================================================
 *   Author	Date       Description
 *   ----------	---------- ---------------------------------------------------
 *   wp	2008-1-24	First release
 *
 * Licensed Materials - Property of APEP
 * =============================================================================
 *    (C) COPYRIGHT Shanghai Auto Mart E-Procurement Co., Ltd. 2007 - 2008
 *    All Rights Reserved.
 *
 *    This software is the confidential and proprietary information of
 *    Shanghai Auto Mart E-Procurement Co., Ltd. ("Confidential Information").
 *    You shall not disclose such Confidential Information and shall use it only
 *    in accordance with the terms of the license agreement you entered into 
 *    with Shanghai Auto Mart E-Procurement Co., Ltd.
 *
 * Noties:
 * =============================================================================
 * 
 */

package com.hitrust.gs.action;

import java.util.ArrayList;

import system.LoginContext;

import com.hitrust.gs.bean.GSOrderAnaDetailAndCategoryBean;
import com.hitrust.gs.business.GSCommunicationApepProcessor;
import com.hitrust.gs.dao.GSOrderDetailDAO;
import com.hitrust.gs.form.GSOrderSubmitForm;
import com.hitrust.gs.lib.GSBaseConstants;
import com.hitrust.gs.service.GSBaseAction;
import com.hitrust.gs.service.GSBaseForm;

public class GSBusOrderResolveReceiveSaveAction extends GSBaseAction {

    /* (non-Javadoc)
     * @see com.hitrust.gs.service.GSBaseAction#execute(com.hitrust.gs.service.GSBaseForm)
     */
    public String execute(GSBaseForm aForm) throws Exception {
        int totalCount = Integer.parseInt(aForm.getRequest().getParameter("totalCount"));
        LoginContext context = (LoginContext) aForm.getSession().getAttribute(GSBaseConstants.LOGIN);
        String tRs = "";
        for(int i=0; i<totalCount; i++) {
            
            String[] tStr = new String[5];
            tStr[0] = aForm.getRequest().getParameter("signOrderDetailId_"+i);
            tStr[1] = aForm.getRequest().getParameter("signQty_"+i);
            tStr[2] = aForm.getRequest().getParameter("signDate_"+i);
            tStr[3] = aForm.getRequest().getParameter("signPrice_"+i);
            tStr[4] = context.getLoginUserName();
            GSOrderDetailDAO tOdlDAO = new GSOrderDetailDAO();
            tRs = GSCommunicationApepProcessor.sendOrderDetailSignSw(tStr);
            tOdlDAO.updateOrderDetailDeliverGoods(tStr[0], Double.parseDouble(tStr[1]),  tStr[2], Double.parseDouble(tStr[3]));
        }
        
        return GSBaseConstants.FORWARD_SUCCESS;
    }

}
